package com.haoshuang.zhouzhoubang.ui.page.mine.contract.fragment

import com.haoshuang.zhouzhoubang.databinding.ItemMyContractChildBinding
import com.haoshuang.zhouzhoubang.model.bean.MyContractBean
import com.haoshuang.zhouzhoubang.widget.UploadFileBean
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.visibleOrGone


/**
 *
 */
class MyContractChildAdapter(data: MutableList<MyContractBean>) :
    BaseBindingQuickAdapter<MyContractBean, ItemMyContractChildBinding>(data) {

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: MyContractBean?) {
        holder.getViewBinding<ItemMyContractChildBinding>().apply {
            tvUploadName.text = item?.team_service
            tvEndTime.text = "${item?.start_time}~${item?.end_time}"
            val list = item?.contract_picture?.map { UploadFileBean(url = it) }
            uploadView.setMediaList(list ?: mutableListOf())
            uploadView.setCanEdit(false)
            llRefuseView.visibleOrGone(item?.status == 3)
            tvRefuse.text = item?.remark
        }
    }

}